package com.yxzz.core.service.impl;

import com.yxzz.core.domain.PLifestyleRecord;
import com.yxzz.core.mapper.PLifestyleRecordMapper;
import com.yxzz.core.service.IPLifestyleRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 生活习惯Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-28
 */
@Service
public class PLifestyleRecordServiceImpl implements IPLifestyleRecordService 
{
    @Autowired
    private PLifestyleRecordMapper pLifestyleRecordMapper;

    /**
     * 查询生活习惯
     * 
     * @param id 生活习惯主键
     * @return 生活习惯
     */
    @Override
    public PLifestyleRecord selectPLifestyleRecordById(Long id)
    {
        return pLifestyleRecordMapper.selectPLifestyleRecordById(id);
    }

    /**
     * 查询生活习惯列表
     * 
     * @param pLifestyleRecord 生活习惯
     * @return 生活习惯
     */
    @Override
    public List<PLifestyleRecord> selectPLifestyleRecordList(PLifestyleRecord pLifestyleRecord)
    {
        return pLifestyleRecordMapper.selectPLifestyleRecordList(pLifestyleRecord);
    }

    /**
     * 新增生活习惯
     * 
     * @param pLifestyleRecord 生活习惯
     * @return 结果
     */
    @Override
    public int insertPLifestyleRecord(PLifestyleRecord pLifestyleRecord)
    {
        return pLifestyleRecordMapper.insertPLifestyleRecord(pLifestyleRecord);
    }

    /**
     * 修改生活习惯
     * 
     * @param pLifestyleRecord 生活习惯
     * @return 结果
     */
    @Override
    public int updatePLifestyleRecord(PLifestyleRecord pLifestyleRecord)
    {
        return pLifestyleRecordMapper.updatePLifestyleRecord(pLifestyleRecord);
    }

    /**
     * 批量删除生活习惯
     * 
     * @param ids 需要删除的生活习惯主键
     * @return 结果
     */
    @Override
    public int deletePLifestyleRecordByIds(Long[] ids)
    {
        return pLifestyleRecordMapper.deletePLifestyleRecordByIds(ids);
    }

    /**
     * 删除生活习惯信息
     * 
     * @param id 生活习惯主键
     * @return 结果
     */
    @Override
    public int deletePLifestyleRecordById(Long id)
    {
        return pLifestyleRecordMapper.deletePLifestyleRecordById(id);
    }
}
